/*
* Copyright (c)  2017, ueboot.com
* All rights reserved.
* 2017-11-04 16:54:08
*/
package com.ueboot.weishop.service.order;

import com.ueboot.weishop.entity.order.OrderEntity;
import com.ueboot.weishop.entity.order.OrderExtensionEntity;
import com.ueboot.core.service.BaseService;
import com.ueboot.weishop.entity.order.OrderIssueEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Created by yangkui  on 2017-11-04 16:54:08.
 * @author yangkui
 * @since 2.0 by autocode
 */
public interface OrderExtensionService extends BaseService<OrderExtensionEntity> {

    /**
     * 根据订单号查询订单扩展属性
     * @param orderNo
     * @return
     */
    OrderExtensionEntity findByOrderNo(String orderNo);

    void saveIssueUpdateOrder(List<OrderEntity> orderList, List<OrderIssueEntity> issueList);

    /**
     * 查询某个期次下的所有订单扩展表
     * @param periodNum
     * @return
     */
    List<OrderExtensionEntity> findByPeriodNum(String periodNum);

    Page<OrderExtensionEntity> findByCustomerOpenIdAndCategoryCodeAndLotteryNot(Pageable pageable, String openId, String categoryCode, String lotteryUn);

    Page<OrderExtensionEntity> findByCustomerOpenIdAndLotteryAndCategoryCode(Pageable pageable, String openId, String categoryCode, String lotteryUn);

    Page<OrderExtensionEntity> findByCustomerOpenIdAndCategoryCode(Pageable pageable, String openId, String categoryCode);
}
